#include "pch.h"
#include <iostream>
#include <string>

using namespace std;

class basic
{
protected:
	string ID;
	string name;
public:
	void display() { cout << "ID为:" << ID << "\n" << "姓名为:" << name << endl; }
	basic(string a, string b) :ID(a), name(b) { }
	basic() { }
};

class Teacher :virtual public basic
{
protected:
	float workinghour;
	float salary;
public:
	void display() { cout << "ID为:" << ID << "\n" << "姓名为:" << name << "\n" << "工作时间为:" << workinghour << "h" << "\n" << "工资为:" << salary << "$" << endl; }
	Teacher(string a, string b, float c) :basic(a, b), workinghour(c) { salary = 4500 + 50 * c; }
	Teacher() { }
};
class Student :virtual public basic
{
protected:
	string courses;
	float studyinghours;
public:
	void display() { cout << "ID为:" << ID << "\n" << "姓名为:" << name << "\n" << "课程为:" << courses << "\n" << "学习时间为:" << studyinghours << "h" << endl; }
	Student(string a, string b, string c, float d) :basic(a, b), courses(c), studyinghours(d) { }
	Student() { }
};

class TeacherAssistant :public Teacher, public Student
{
public:
	void display() { cout << "ID为:" << ID << "\n" << "姓名为:" << name << "\n" << "工作时间为:" << workinghour << "h" << "\n" << "工资为:" << salary << "$" << "\n" << "课程为:" << courses << "\n" << "学习时间为:" << studyinghours << "h" << endl; }
	TeacherAssistant(string a, string b, float c, string d, float e) :basic(a, b) { workinghour = c; courses = d; studyinghours = e;salary = 35 * workinghour; }
};

int main()
{
	Teacher a("0001", "王老师", 50);
	cout << "老师数据:" << endl;
	a.display();
	Student b("0002", "小明", "数学", 3);
	cout << "学生数据:" << endl;
	b.display();
	TeacherAssistant c("0003", "小王", 10, "英语", 2);
	cout << "助教数据:" << endl;
	c.display();
	return 0;
}